/**
 * Created by Administrator on 2017/5/18.
 */
import App from '../App';
const login = r => require.ensure([], () => r(require('../pages/login/login')), 'login')
const home = r => require.ensure([], () => r(require('../pages/home/home'), 'home'))
const general = r => require.ensure([], () => r(require('../pages/general/general'), 'general'))
const charts = r => require.ensure([], () => r(require('../pages/charts/charts'), 'charts'))
const user = r => require.ensure([], () => r(require('../pages/user/index'), 'user_index'))
const userCreate = r => require.ensure([], () => r(require('../pages/user/add'), 'userAdd'))
const Plugins = r => require.ensure([], () => r(require('../pages/index/index'), 'Index'))
const PluginsAdd = r => require.ensure([], () => r(require('../pages/index/add'), 'Index'))
const backup = r => require.ensure([], () => r(require('../pages/backup/backup'), 'Backup'))
const backupIndex = r => require.ensure([], () => r(require('../pages/backup/index'), 'BackUpIndex'))
const backupReduction = r => require.ensure([], () => r(require('../pages/backup/reduction'), 'backupReduction'))
const test_one = r => require.ensure([], () => r(require('../pages/test/index'), 'test'))
const upload_image = r => require.ensure([], () => r(require('../pages/upload/upload'), 'upload_image'))
const router = [
  {
    path: '/',    // 根目录路由
    component: App,
    children: [    // 二级目录
      {path: '', component: login},
      {
        path: '/home', name: 'home', component: home, meta: {requireAuth: true,},
        children: [
          {path: 'general', name: 'general', component: general, meta: {requireAuth: true}},
          {path: 'charts', name: 'charts', component: charts, meta: {requireAuth: true}},
          {path: 'user', name: 'user', component: user, meta: {requireAuth: true}},
          {path: 'userCreate', name: 'userCreate', component: userCreate, meta: {requireAuth: true}},
          {path: 'index', name: 'index', component: Plugins, meta: {requireAuth: true}},
          {path: 'indexCreate', name: 'indexCreate', component: PluginsAdd, meta: {requireAuth: true}},
          {path: 'backup', name: 'backup', component: backup, meta: {requireAuth: true}},
          {path: 'backupIndex', name: 'backupIndex', component: backupIndex, meta: {requireAuth: true}},
          {path: 'backupReduction', name: 'backupReduction', component: backupReduction, meta: {requireAuth: true}},
          {path: 'test_one', name: 'test_one', component: test_one, meta: {requireAuth: true}},
          {path: 'upload', name: 'upload', component: upload_image, meta: {requireAuth: true}}
        ]
      }
    ]
  }
];
export default router;
